package cn.ljh.service.impl;

import cn.ljh.entity.Foods;
import cn.ljh.dao.FoodsMapper;
import cn.ljh.service.FoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class FoodsServiceImpl implements FoodsService {

    @Autowired
    private FoodsMapper foodsMapper;

    @Override
    public List<Foods> getFoodsByCondition(Map<String, Object> condition) {
        return foodsMapper.selectByCondition(condition);
    }

    @Override
    public boolean deleteFoods(Integer id) {
        int result = foodsMapper.deleteById(id);
        return result > 0;
    }
}    